package com.kaili.basic.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.kaili.basic.mapper.BaseFinanceSubjectMapper;
import com.kaili.basic.pojo.dto.BaseFinanceSubjectQueryDTO;
import com.kaili.basic.pojo.entity.BaseFinanceSubjectEntity;
import com.kaili.basic.pojo.vo.BaseFinanceSubjectExport;
import com.kaili.basic.service.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class BaseFinanceSubjectServiceImpl extends ServiceImpl<BaseFinanceSubjectMapper, BaseFinanceSubjectEntity> implements BaseFinanceSubjectService {

    @Autowired
    private BaseFinanceSubjectMapper baseFinanceSubjectMapper;
    @Override
    public Long queryFinanceSujectCode() {
        return baseFinanceSubjectMapper.queryFinanceSujectCode();
    }

    @Override
    public Page<BaseFinanceSubjectEntity> queryPageList(Page<BaseFinanceSubjectEntity> page, BaseFinanceSubjectQueryDTO queryDTO) {
        List<BaseFinanceSubjectEntity> list= baseFinanceSubjectMapper.queryPageList(page,queryDTO);
        page.setRecords(list);
        return page;
    }

    @Override
    public List<BaseFinanceSubjectExport> export(BaseFinanceSubjectQueryDTO queryDto) {
        return baseFinanceSubjectMapper.export(queryDto);
    }

    @Override
    public List<BaseFinanceSubjectEntity> queryAllList() {
        return baseFinanceSubjectMapper.queryPageList();
    }
}
